﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using PairingMatrix.Common.Enum;

namespace PairingMatrix.View.Converter
{
    public class PairingLevelToColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value is PairingLevel)
            {
                switch ((PairingLevel)value)
                {
                    case PairingLevel.ShouldDefinitelyPair : return Colors.Green;
                    case PairingLevel.TryToPairMore : return new Color{A = 100, B = 155, G = 255, R = 155};
                    case PairingLevel.CanPair : return Colors.White;
                    case PairingLevel.AvoidPairing : return new Color{A = 100, G = 155, B = 155, R = 255};
                    case PairingLevel.ShouldDefinitelyNotPair : return Colors.Red;
                }
            }
            return Colors.Black;
        }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
